using UnityEngine;

public class OpticalAimHUD : MonoBehaviour
{
	public static OpticalAimHUD instance;

	public bool modeAimActive;

	public GameObject butOpticalAim;

	public GameObject sprFullscreen;

	public GameObject sprPointAim;

	public GameObject ShotButton;

	public bool stateOpticalActive;

	private void Awake()
	{
		instance = this;
	}

	private void Start()
	{
		SetActiveModeAim(false);
	}

	private void OnDestroy()
	{
		instance = null;
	}

	public void SetActiveModeAim(bool val)
	{
		if (GameController.instance != null)
		{
			WalkWindow.instance.aimHUD.hideNormalAim(val);
			WalkWindow.instance.aimHUD.SetPositionCenter(val);
		}
		modeAimActive = val;
		if (sprFullscreen != null)
		{
			sprFullscreen.SetActive(val);
		}
		if (sprPointAim != null)
		{
			sprPointAim.SetActive(val);
		}
		ShotButton.SetActive(val);
	}

	public void SetActiveButAim(bool val)
	{
		if (!val || GameController.instance.playerScript.weaponManager.currentWeaponScript != null)
		{
		}
		if (butOpticalAim.activeSelf != val)
		{
			butOpticalAim.SetActive(val);
		}
	}
}
